<!DOCTYPE html>
<!-- saved from url=(0028)http://www.visaplatform.com/ -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>智慧互联网村镇平台</title>
<meta name="keywords" content="智慧互联网村镇平台">
<meta name="description" content="">
<script type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script> 
<script type="text/javascript" th:src="@{/js/libs/layer/layer.js}"></script>
<link rel="stylesheet" th:href="@{/css/layer/layer.css}" id="layui_layer_skinlayercss">
<script type="text/javascript" th:src="@{/js/libs/H-ui.admin/H-ui.min.js}"></script> 
<script type="text/javascript" th:src="@{/js/libs/H-ui.admin/H-ui.admin.js}"></script> 
<script type="text/javascript" th:src="@{/js/shiro.js}"></script>
<script type="text/javascript">shiro.baseUrl = '[[@{/}]]'; </script>
<script type="text/javascript" th:src="@{/js/custom.js}"></script>
<script type="text/javascript" th:src="@{/js/msd.js}"></script>
<link th:href="@{/css/login4mebr.css}" rel="stylesheet" type="text/css">
<link th:href="@{/css/font-awesome.css}" rel="stylesheet" type="text/css">
<style type="text/css">
  input:-webkit-autofill {
	  -webkit-box-shadow: 0 0 0 1000px white inset !important;
	}
	.cd-user-modal-container{
		margin:0;
		padding:0;
		-webkit-transform: translateY(0px);
	    -moz-transform: translateY(0px);
	    -ms-transform: translateY(0px);
	    -o-transform: translateY(0px);
	    transform: translateY(0px)
	}
	body{
		width:100%;
		padding:0;
		margin:0;
		overflow:hidden;
	}
	 .layer-anim{
		overflow:hidden !important;
	}
</style>
</head>
	<body>
		<div class="cd-user-modal">
			<div class="cd-user-modal-container">
				<ul class="cd-switcher">
					<li class="xhusji" style="float: left; text-align: left;"><img src="" width="14px" height="14px">
					登录</li>
					<li class="delopw plkopi" style="float: right; text-align: right;">
						<img src="" width="14px" height="14px">
					注册</li>
				</ul>
				<div id="cd-signup" style="display: none;">
					<!-- 注册表单 -->
					<form class="cd-form" id="form-user-reg" method="post" onsubmit="return executeReg();">
						<input type="text" placeholder="请输入您的手机号" class="input phol" style="padding-left: 10px;" id="telphone" name="telphone" onblur="validation()"><br>
						<input type="password" placeholder="请输入您的密码（6~8位，字母数字均可）" class="input pass" style="padding-left: 10px;" id="passwords" name="passwords"><br>
						<input type="hidden" name="type" value="0">
						<input type="submit" class="wite" value="注 册">
						<div class="jshd">
						<label for="online" class="boxdsa">
		         		 </label>
						</div>
					</form>
				</div>
				<div id="cd-login" style="display: block;">
					<!-- 登录表单 -->
					<form class="cd-form" id="form-user-login" method="post" onsubmit="return executeLogin();">
						<input type="text" placeholder="请输入您注册时使用的手机号" class="input" style="padding-left: 10px;" id="telphones" name="telphones"><br>
						<input type="password" placeholder="请输入您注册时使用的密码" class="input pass" style="padding-left: 10px;" id="password" name="password"><br>
						<input type="submit" class="wite" value="登 录">
						<div class="jshd">
						<label for="online" class="boxdsa">
		         		 </label>
						</div>
					</form>
				</div>
			</div>
		</div>
		
	<script type="text/javascript">
	//执行登录	
	function executeLogin() {
		var telphones = $.trim($('#telphones').val());
		var password = $.trim($('#password').val());
		if(shiro.util.isEmpty(telphones)) {
			layer.msg('手机号不能为空');
			return false;
		}
		else if(shiro.util.isEmpty(password)) {
			layer.msg('密码不能为空');
			return false;
		}else{
			shiro.ajax({
	 			url: '/client/login/executeLogin',
	 			data:$('#form-user-login').serialize(),
	 			success: function(data) {
	 				if(data.result == 0) {
	 					layer.msg(data.message);
	 					window.parent.location.href = shiro.baseUrl + '/client/index/main';
	 				} else {
	 					layer.msg(data.message,{time: 1500});
	 					$('#telphone').focus();
	 				}
	 			}
	 		});
		}
		return false;
	}
		
		// 点击显示隐藏
		$(".delopw").click(function() {
			$("#cd-signup").show();
			$("#cd-login").hide();
		});
		$(".xhusji").click(function() {
			$("#cd-login").show();
			$("#cd-signup").hide();
		});
		//注册登录样式
		$(function() {
			$(".delopw").click(function() {
				$(this).removeClass("plkopi");
				$("#register").val("");
				$("#passwords").val("");
				if(''=="login"){
					$("#channelCode").val("");	
				}else{
					$("#channelCode").val('');	
				}
				$(this).css({float:"left",textAlign:"left"});
				$(".xhusji").addClass("plkopi1");
				$(".xhusji").css({float:"right",textAlign:"right"});
			});
		});
		$(function() {
			$(".xhusji").click(function() {
				$(this).removeClass("plkopi1");
				$(this).css({float:"left",textAlign:"left"});
				$(".delopw").addClass("plkopi");
				$(".delopw").css({float:"right",textAlign:"right"});
			});
		});
		// 兼容ie678 placeholder标签
		$(document).ready(function() {
			var doc = document,
				inputs = doc.getElementsByTagName('input'),
				supportPlaceholder = 'placeholder' in doc.createElement('input'),
				placeholder = function(input) {
					var text = input.getAttribute('placeholder'),
						defaultValue = input.defaultValue;
					if(defaultValue == '') {
						input.value = text
					}
					input.onfocus = function() {
						if(input.value === text) {
							this.value = ''
						}
					};
					input.onblur = function() {
						if(input.value === '') {
							this.value = text
						}
					}
				};
			if(!supportPlaceholder) {
				for(var i = 0, len = inputs.length; i < len; i++) {
					var input = inputs[i],
						text = input.getAttribute('placeholder');
					if(input.type === 'text' && text) {
						placeholder(input)
					}
				}
			}
		});
	
	//执行注册	
	 function executeReg() {
		var telphone = $.trim($('#telphone').val());
		var passwords = $.trim($('#passwords').val());
		if(shiro.util.isEmpty(telphone)) {
			layer.msg('手机号不能为空!');
			return false;
		}else{
			var temp = shiro.form.isNumber(telphone);
			if(temp == false){
				layer.msg('手机号码只能是数字!');
				return false;
			}else{
				var temps = shiro.form.isTelphone(telphone);
				if(temps == false){
					layer.msg('请输入正确的手机号码!');
					return false;
				}
			}
		}
		if(shiro.util.isEmpty(passwords)) {
			layer.msg('密码不能为空!');
			return false;
		}else{
			if(passwords.length<6){
				layer.msg('请输入6位数以上的密码!');
				return false;
			}
		}
		shiro.ajax({
 			url: '/client/login/register',
 			data:$('#form-user-reg').serialize(),
 			success: function(data) {
 				if(data.result == 0) {
 					layer.msg("注册成功!", {time: 1500});
 					window.parent.location.href = shiro.baseUrl + '/client/index/main';
 				} else {
 					$("#cd-signup").show();
 					$("#cd-login").hide();
 					layer.msg(data.message, {time: 1500});
 					$('#telphone').focus();
 				}
 			}
 		});
		return false;
	} 
	
	//校验手机号
	function validation(){
		var tel = $("#telphone").val();
		if(tel == null || tel == ""){
			layer.msg('手机号不能为空!');
			return false;
		}else{
			var temp = shiro.form.isNumber(tel);
			if(temp == false){
				layer.msg('电话号码只能是数字!');
				return false;
			}else{
				var tempPhone = shiro.form.isTelphone(tel);
				if(!tempPhone){
					layer.msg('请输入正确的电话号码!');
					return false;
				}else{
						return true;
					}
				}
			}
		}
</script>
</body>
</html>